# README
Title:  The Hedging Channel of Exchange Rate Determination
Author: Gordon Liao and Tony Zhang

This is the replication package for "The Hedging Channel of Exchange Rate Determination"

This folder conatins three subfolders.
* \Code\ contains R code used to produce all of the tables and figures in the paper
* \CleanData\ contains the cleaned datasets used to produce all of the tables and figures in the paper
* \Out\ contains the output produced from \Code\

## DATA

All the data used to produce the tables and figures are provided in the /Data/ subdirectory. These data are written in .fst format, which can be read into R using the fst package. These files are:
* hedgeratio_cvix.csv - Contains data to produce Figure 1.
* MainPanel_D.fst     - Contains the panel data used for analysis with financial variables at the daily frequency.
* MainPanel_M.fst     - Contains the panel data used for analysis with financial variables collapsed to the monthly frequency.
* S2Panel_M.fst       - Contains the subset of data required for the analysis of the effect of Solvency 2 on cross-currency bases.
* xccyextended.fst    - Contains cross-currency bases data at the daily frequency from a variety of sources.
Please see the paper for details on data sources.

## CODE

Follow these steps to create the tables and figures from the paper:
	1. Start R and change working directories to the /Code/ directory.
	2. Run Analysis.R. This will produce all Tables and Figures and put them into the /Out/ directory.

Analysis.R runs Init.R, which should automatically checks to see if the required R packages are installed or not. If not, then Init.R will install the package.

Analysis.R also contains comments that describe which table or figure is being produced by what section of code.

Thank you for your interest in our paper. Please reach out to Tony Zhang at tony.zhang@frb.gov if you have any questions about this replication package.